define(function(require){
	var $=require("jq");
	var dialogcss=require("/pinzhiV2.0/css/pz-dialog.css");
	var Dialog=require("pz_use_dialog.js");
	$(document).ready(function(){
		var activeBtn=$(".active").eq(0);
		activeBtn.click(function(){
			if(!$(this).hasClass("active-ok")){
				var prompt=new PZ_Dialog({
					type:"prompt",
					text:"请输入激活码",
					buttonSureText:"激活",
					buttonCancelText:"放弃",
					callBack:function(value){
						$.post("/activeUser.do", {activeCode:value}, function(msg){
							var tips=new Dialog({
								  type:"tips",
								  text:msg.message,
								  delay:1,			//提示框延时几秒，不提供默认为3秒关闭
								  mask:"transparent"
								  });
							if(msg.ret==1) {
								//禁用激活按钮
								activeBtn.addClass("active-ok").text("你已激活");
								window.location.href="/myLevel.do?menu_id=24";
							}
						}, "json");
					},
					mask:0.3,
					isDrag:true
				});
			};
		});
		
		var level = 2,
		module_table=$(".module-table");
		for(var i =1;i<level;i++){
			module_table.addClass("vip-star-into-"+i);
		};
	});
});